<div id="root">

    <eltable :data="tableData">
      <tablecolumn prop="id" label="编号"></tablecolumn>
      <tablecolumn prop="name" label="姓名"></tablecolumn>
      <tablecolumn prop="age" label="年龄"></tablecolumn>
      <tablecolumn label="性别">
      <template slot-scope="item"> {{ item.sex == 1 ? '女' : '男' }} </template>
    </tablecolumn>
   </eltable>

</div>

<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="./table.js"></script>

<script>
const vm = new Vue({
    el: "#root",
    data: {
        tableData:[
        { id: 1, name: "冰墩墩", age: 3, sex:2 },
        { id: 2, name: "雪容融", age: 2, sex:1 },
        { id: 3, name: "喜洋洋", age: 5, sex:2},
        { id: 3, name: "灰太狼", age: 7, sex:2},
        ]
        
    }
})
</script>